package pl.edu.agh.io.gpstracker.client.dto;

/**
 * Typ usera.
 * 
 * @author wkedzior
 * 
 */
public enum UserType {
	MOBILE_USER(0), WEB_USER(1);

	private int value;

	private UserType(Integer value) {
		this.value = value;
	}

	public int getValue() {
		return value;
	}

	/**
	 * 
	 * @param type
	 * @return
	 */
	public static UserType recognizeType(Short type) {
		switch (type) {
		case 0:
			return MOBILE_USER;
		case 1:
			return WEB_USER;
		default:
			throw new IllegalArgumentException();
		}
	}
}
